function formatTime(milliseconds: number) {
  milliseconds = milliseconds / 1000;
  const seconds = Math.floor((milliseconds / 1000) % 60);
  const minutes = Math.floor((milliseconds / (1000 * 60)) % 60);
  const hours = Math.floor(milliseconds / (1000 * 60 * 60));
  // const days = Math.floor(milliseconds / (1000 * 60 * 60 * 24));
  let h = hours ? `${hours}:` : "";
  let m = minutes ? `${minutes < 10 ? "0" + minutes : minutes}:` : "00:";
  let s = seconds ? `${seconds < 10 ? "0" + seconds : seconds}` : "0";
  return `${h}${m}${s}`;
}

export { formatTime };
